﻿using System;
using PM.Entity;
using PM.IRepository;
using System.Linq.Expressions;

namespace PM.Repository
{
    public class PositionDAL : BaseDAL<仓库仓位>, IBase<仓库仓位>
    {
        public 仓库仓位 SearchByPosition(string position,string pandianbianhao)
        {
            // position = position.Substring(1);
            Expression<Func<仓库仓位, bool>> where;
            if ("".Equals(pandianbianhao))
            {
                where = (p => p.仓位编号 == position && p.盘点 == false);
            }
            else {
                where = (p => p.仓位编号 == position);
            }         
            仓库仓位 entity = GetByWhere(where);
            return entity;
        }
    }
}
